import { REACT_TEXT } from "./stants";

export function toObject(element) {
    return typeof element === 'string' || typeof element === 'number' ? {
        type: REACT_TEXT,
        content: element
    } : element;
}

export function isValidator(arg) {
    return !(typeof arg === 'object' && arg === null || typeof arg === 'undefined');
}

export function hasOwnProp(target, property) {
    return target.hasOwnProperty(property);
}